#ifndef __HT1621_H
#define __HT1621_H

#include "main.h"

#define LCD_CS  GPIO_PIN_1  // PA1
#define LCD_RD  GPIO_PIN_2  // PA2
#define LCD_WR  GPIO_PIN_3  // PA3
#define LCD_DA  GPIO_PIN_3  // PD3

#define ComMode    0x52  //4COM,1/3bias  1000    010 1001  0  
#define RCosc      0x30  //内部RC振荡器(上电默认)1000 0011 0000 
#define LCD_on     0x06  //打开LCD 偏压发生器1000     0000 0 11 0 
#define LCD_off    0x04  //关闭LCD显示 
#define Sys_en     0x02  //系统振荡器开 1000   0000 0010 
#define CTRl_cmd   0x80  //写控制命令 
#define Data_cmd   0xa0  //写数据命令  

#define LCD_COM1 0x80
#define LCD_COM2 0x40
#define LCD_COM3 0x20
#define LCD_COM4 0x10

// 各模式显示字符 -- LCD段码屏
#define LCD_OFFSET_BEGIN    0x0C0D0A    // Sc
#define LCD_PID_BEGIN       0x0E0A0A    // P
#define LCD_ALERT_BEGIN     0x0F100A    // AL
#define LCD_TI_BEGIN        0x11120A    // TI
#define LCD_L_BEGIN         0x100A0A    // L
#define LCD_PWM_BEGIN       0x130A0A    // H
#define LCD_DEFAULT         0x140A0A    // d
#define LCD_LOCK_BEGIN      0x10150D    // Loc

extern void LCD_Init(void);
extern void LCD_SendBit(uint8_t sdata,uint8_t cnt);
extern void LCD_SendCmd(uint8_t command);
extern void LCD_ShowNum(uint8_t n1, uint8_t n2, uint8_t n3, uint8_t n4, uint8_t c);
extern void LCD_Refresh(void);

#endif
